home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / ASM-P.ZIP / PROTHD.ASM < prev    next >
Assembly Source File  |  1992-11-29  |  2KB  |  76 lines

  1. code segment public 'code'
  2.         assume    cs:code, ds:code, es:code
  3.         org    100h
  4.  
  5. Main:        mov    ah,30h            ; fn 30h = Get Dosversion
  6.         int    21h            ; int 21h
  7.         cmp    al,4            ; major dosversion 
  8.         sbb    si,si
  9.         mov    ah,52h            ; get internal list of lists
  10.         int    21h            ; int 21h
  11.         lds    bx,es:[bx]        ; get pointer to first drive
  12.                         ; paramenter block
  13.  
  14. Search:        mov    ax,ds:[bx+si+15h]    ; get segment of device header
  15.         cmp    ax,70h            ; dos device header ??
  16.         jne    Next            ; no, go to next device
  17.         cmp    byte ptr ds:[bx],0
  18.         je    Next
  19.         xchg    ax,cx
  20.         mov    di,ds:[bx+si+13h]    ; get offset of device header
  21.         mov    word ptr ds:[bx+si+13h],offset Header
  22.         mov    ds:[bx+si+15h],cs    ; set addres of new device
  23. Next:        lds    bx,ds:[bx+si+19h]    ; next drive parameter block
  24.         cmp    bx,-1            ; last block ?
  25.         jne    Search            ; no, go to Search
  26.         jcxz    Error
  27.  
  28.         mov    ds,cx
  29.         mov    si,di
  30.         push    cs
  31.         pop    es
  32.         mov    di,offset Header
  33.         cld
  34.         movsw
  35.         movsw
  36.         movsw
  37.         mov    ax,offset Strategy
  38.         stosw
  39.         mov    ax,offset Interrupt
  40.         stosw
  41.         push    di
  42.         mov    di,offset Strategy
  43.         mov    al,0eah
  44.         stosb
  45.         movsw
  46.         mov    ax,cx
  47.         stosw
  48.         mov    di,offset Interrupt
  49.         mov    al,0eah
  50.         stosb
  51.         movsw
  52.         mov    ax,cx
  53.         stosw
  54.         pop    di
  55.         movsw
  56.         mov    ax,3100h
  57.         mov    dx,20h
  58.         int    21h
  59.  
  60. Error:        mov    ax,4c01h
  61.         int    21h
  62.  
  63. Header        db    12 dup(?)
  64. Interrupt    db    5 dup(?)
  65. Strategy    db    5 dup(?)
  66.  
  67.  
  68. code ends
  69.  
  70. end Main
  71. 
  72. ;  ─────────────────────────────────────────────────────────────────────────
  73. ;  ────────────────────> and Remember Don't Forget to Call <────────────────
  74. ;  ────────────> ARRESTED DEVELOPMENT +31.79.426o79 H/P/A/V/AV/? <──────────
  75. ;  ─────────────────────────────────────────────────────────────────────────
  76.